home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlxinstl.zip
/
ASSEMBLY.MAC
next >
Wrap
Text File
|
1991-01-15
|
21KB
|
721 lines
;****************************** MACROS ***********************************
INPUT MACRO field,dlen,mrow,mcol,mscrn
local key,next_key,get_key,exit_bridge,unprintable,bsp,_cr,exit,help,restore,_23,_71,_3f,next_key_bridge,_0f,_1e,_44,_49,_51
mov field_start,di
calc_addr mrow,mcol
cursor ;;position cursor and return attribute and character in bx
push ax
mov ax,dlen
mov cx,col
add ax,cx
mov cx,ax ;;get absolute column for end of field
pop ax
next_key:
CALL GETKEY ;;READ CHARACTER FROM KEYBOARD
cmp ah,0DH ;;if carriage return go get next field
jne _0f
jmp _cr
_0f:
cmp ah,0FH ;;if left tab go back to previous field
jne _44
jmp _cr
_44:
cmp ah,44H ;;if F10
jne _51
jmp help
_51:
cmp ax,51feh ;;if Page down
jne _49
je exit_bridge
_49:
cmp ax,49feh ;;if Page up
jne _71
je exit_bridge
_71:
cmp ah,71H ;;if AF10
jne _3f
jmp exit_bridge
next_key_bridge:
jmp next_key
_3f:
cmp ah,3FH ;;if F5
je next_key_bridge
cmp ah,40H ;;if F6
je next_key_bridge
cmp ah,41H ;;if F7
je next_key_bridge
cmp ah,42H ;;if F8
je next_key_bridge
cmp ah,43H ;;if F9
je next_key_bridge
cmp ah,3BH ;;if F1
je exit_bridge
cmp ah,3CH ;;if F2
je exit_bridge
cmp ah,3DH ;;if F3
je exit_bridge
cmp ah,3EH ;;if F4
je exit_bridge
cmp al,0 ;;al = 0 if printable character
jne unprintable
cmp col,cx
jne key ;;go get next character
dec col
jmp next_key_bridge
key:
jmp next_key_bridge
exit_bridge:
jmp _cr
help:
push dx
mov dx,offset mscrn
call wakevid ;;macro call
pop dx
jmp next_key_bridge
unprintable:
jmp next_key_bridge
;
_CR:
push ax
mov field_stop,di
mov row,mrow
mov col,mcol
cursor
STORE_FIELD field,dlen
pop ax
exit:
func_key
endm
dsklf macro
mov dx,offset linefd ;;writeline feed to file
mov cx,1
mov bx,outfile_handle
mov ax,4000H
int 21H ;;write to file
endm
dskcrlf macro
mov dx,offset crlf ;;load carriage return,line feed
mov cx,2
mov bx,outfile_handle
mov ax,4000H
int 21H ;;write to file
endm
open macro fcb ;;open file
mov dx,offset fcb
mov ax,0F00H
int 21H
endm
close macro fcb ;;open file
mov dx,offset fcb
mov ax,1000H
int 21H
endm
set_dta macro buffer ;;set disk transfer area
mov dx,offset buffer
mov ax,1A00H
int 21H
endm
read_ran macro fcb ;;random read
mov dx,offset fcb
mov ax,2100H
int 21H
endm
write_ran macro fcb ;;random write
mov dx,offset fcb
mov ax,2200H
int 21H
endm
size_file macro fcb
mov dx,offset fcb
mov ax,2300H
int 21H
endm
set_relatice_record macro fcb
mov dx,offset fcb
mov ax,2400H
int 21H
endm
set_vector macro interrupt,handler_start
mov al,interrupt
mov dx,offset handler_start
mov ax,2500H
int 21H
endm
ran_block_read macro fcb,count,rec_size
mov dx,offset fcb
mov cx,count
mov word ptr fcb[14],rec_size
mov ax,2700H
int 21H
endm
ran_block_write macro fcb,count,rec_size
mov dx,offset fcb
mov cx,count
mov word ptr fcb[14],rec_size
mov dx,offset fcb
mov ax,2800H
int 21H
endm
parse macro string,fcb
mov si,offset string
mov di,offset fcb
push es
push ds
pop es
mov ax,290FH ;;bits 0, 1, 2, 3 on
int 21H
pop es
endm
get_date macro
mov ax,2A00H
int 21H
endm
set_date macro year,month,day
mov cx,year
mov dh,month
mov dl,day
mov ax,2B00H
int 21H
endm
get_time macro
mov ax,2C00H
int 21H
endm
set_time macro hours,minutes,seconds,hundredths
mov ch,hour
mov cl,minutes
mov dh,seconds
mov dl,hundredths
mov ax,2D00H
int 21H
endm
verify macro switch
mov al,switch
mov ah,2EH
int 21H
endm
get_dta macro
mov ah,2F00H
int 21H
endm
get_version macro
mov ax,3000H
int 21H
endm
ctrl_c_ck macro action,state
mov al,action
mov dl,state
mov ax,3300H
int 21H
endm
get_vector macro interrupt
mov al,interrupt
mov ax,3500H
int 21H
endm
get_disk_space macro drive
mov dl,drive
mov ax,3600H
int 21H
endm
make_dir macro path
mov dx,offset path
mov ax,3900H
int 21H
endm
rem_dir macro path
mov dx,offset path
mov ax,3A00H
int 21H
endm
change_dir macro path
mov dx,offset path
mov ax,3B00H
int 21H
endm
create_handle macro path,attrib
mov dx,offset path
mov cx,attrib
mov ax,3C00H
int 21H
endm
open_handle macro path,access
mov dx,offset path
mov al,access
mov ah,3DH
int 21H
endm
close_handle macro handle
mov bx,handle
mov ax,3E00H
int 21H